<template>
  <div v-show="alertShow" class="alert">
    <div class="maskAlert wapMask">
      <div class="alertText wapText">
        <slot></slot>
        <!-- 插槽 -->
      </div>
      <div class="alertSure wapSure" @click="onClose">确定</div>
    </div>
  </div>
</template>
<script>
export default {
  name: "popalert",
  props: {
    alertShow: {
      type: Boolean,
      default: false
    }
  },
  model: {
    prop: "alertShow",
    event: "alert"
  },
  data() {
    return {};
  },
  methods: {
    onClose() {
      this.$emit("alert", false);
    }
  }
};
</script>
<style lang="scss" scoped>
.alert {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 99999;
  .maskAlert {
    width: 500px;
    background-color: #fff;
    border-radius: 20px;
    font-size: 30px;
    margin-top: -50px;
    .alertText {
      text-align: center;
      padding: 50px 30px;
    }
    .alertSure {
      text-align: center;
      padding: 20px;
      border-top: 1px solid #dadada;
    }
  }
}
</style>